package com.fiume.controller;

import com.fiume.dto.CheckgroupDto;
import com.fiume.pojo.CheckgroupT;
import com.fiume.service.CheckgroupService;
import com.fiume.support.PageResult;
import com.fiume.support.QueryPageBean;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * Description:
 * </p>
 *
 * @author fiume
 * @version v1.0.0
 * @create 2021-01-04 16:54
 * @see com.fiume.controller
 */
@RestController
@RequestMapping("/checkgroup")
public class CheckGroupController {
    @DubboReference
    private CheckgroupService checkgroupService;

    @PostMapping("/save")
    public Boolean save(@RequestBody CheckgroupDto checkgroupDto){
        return checkgroupService.saveGroup(checkgroupDto);
    }

    @GetMapping("/findAll")
    public List<CheckgroupT> findAll(){
        return checkgroupService.list();
    }

    @PostMapping("/findByPage")
    public PageResult findByPage(@RequestBody QueryPageBean queryPageBean){
        return checkgroupService.findByPage(queryPageBean);
    }
}
